package br.utfpr.edu.dao;

import java.util.List;

import br.utfpr.edu.bean.Bed;
import br.utfpr.edu.business.Negocio;
import br.utfpr.edu.business.NegocioException;
import br.utfpr.edu.interfaces.IBed;

public class BedDao extends Negocio implements IBed{

	private static final long serialVersionUID = -665359653215100343L;
	private Bed bed;
	
	public BedDao(){
		bed = new Bed();
	}

	public void inserir()throws NegocioException {
		super.inserir(bed);
	}

	public void alterar() throws NegocioException{
		super.alterar(bed);
	}

	public void deletar() throws NegocioException {
		super.deletar(Bed.class,bed);
	}

	public List<Bed> pesquisar(String gene)throws NegocioException{
		List<Bed> colecao = getList(Bed.class,"SELECT b FROM Bed b WHERE b.gene.id = ?1 ORDER BY b.chromStart,b.chromEnd", Integer.parseInt(gene));
		return colecao;
	}
	
	public void limpar() {
		// TODO Auto-generated method stub
	}

	public Bed getBed() {
		return bed;
	}

	public void setBed(Bed bed) {
		this.bed = bed;
	}

}
